<template>
    <div class="student">
        <h4>学生姓名:{{name}}</h4>
        <h4>学生年龄:{{age}}</h4>
        <button @click="sendStudentName">学生名给学校</button>
    </div>
</template>

<script>

    export default {
        name : 'Student',
        data(){
            return {
                name:'zw',
                age:18,
            }
        },
        methods:{
            sendStudentName(){
                this.$bus.$emit('hello', 666);
            }
        }
    };
</script>
<style scoped>
    .student{
        background-color: springgreen;
        padding: 5px;
        margin-top: 30px;
    }
</style>
